#ifndef _ICMPSOCKETIMPL_H_
#define _ICMPSOCKETIMPL_H_

#include "net/RawSocketImpl.hpp"
#include "net/IPAddress.hpp"
#include "net/SocketAddress.hpp"
#include "net/ICMPPacket.hpp"

NET_NAMESPACE_BEGIN

class CICMPSocketImpl : public CRawSocketImpl
{
public:
	CICMPSocketImpl(CIPAddress::Family family, int dataSize, int ttl, int timeout);

	int sendTo(const void*, int, const CSocketAddress& address, int flags = 0);
	int receiveFrom(void*, int, CSocketAddress& address, int flags = 0);

protected:
	~CICMPSocketImpl();

private:
	CICMPPacket m_icmpPacket;
	int			m_timeout;
};

NET_NAMESPACE_END

#endif
